/**
 * The Community Project
 * Copyright Team1 Productions
 * 
 * Joshua Amick
 * Stephen Cunningham
 * Thema Davis
 * Tomika Dawson
 * Lucie DeCristofaro
 * 
 * All Rights Reserved.
 */

package com.forms;

import java.sql.Timestamp;

import org.apache.struts.action.ActionErrors;

import com.domain.Announcement;
import com.domain.Event;
public class CreateAnnOrEventForm  extends BaseCommunityForm {
    
    private String userId;
    private String annOrEvent;
    private String startYear;
    private String startMonth;
    private String startDay;
    private String endYear;
    private String endMonth;
    private String endDay;
    private String startHour;
    private String startMinutes;
    private String startAmOrPm;
    private String endHour;
    private String endMinutes;
    private String endAmOrPm;
    private String location;
    private String title;
    private String description;
    private String details;
    private String availability;
    private String specialInst;
    

    public ActionErrors getActionErrors() {
        if (errors == null) {
            errors = new ActionErrors();
        }

        return errors;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getAnnOrEvent() {
        return annOrEvent;
    }

    public void setAnnOrEvent(String annOrEvent) {
        this.annOrEvent = annOrEvent;
    }

    public String getStartYear() {
        return startYear;
    }

    public void setStartYear(String startYear) {
        this.startYear = startYear;
    }

    public String getStartMonth() {
        return startMonth;
    }

    public void setStartMonth(String startMonth) {
        this.startMonth = startMonth;
    }
    
    public String getStartDay() {
        return startDay;
    }

    public void setStartDay(String startDay) {
        this.startDay = startDay;
    }

    public String getEndYear() {
        return endYear;
    }

    public void setEndYear(String endYear) {
        this.endYear = endYear;
    }

    public String getEndMonth() {
        return endMonth;
    }

    public void setEndMonth(String endMonth) {
        this.endMonth = endMonth;
    }
    
    public String getEndDay() {
        return endDay;
    }

    public void setEndDay(String endDay) {
        this.endDay = endDay;
    }

    public String getStartHour() {
        return startHour;
    }

    public void setStartHour(String startHour) {
        this.startHour = startHour;
    }

    public String getStartMinutes() {
        return startMinutes;
    }

    public void setStartMinutes(String startMinutes) {
        this.startMinutes = startMinutes;
    }
    
    public String getStartAmOrPm() {
        return startAmOrPm;
    }

    public void setStartAmOrPm(String startAmOrPm) {
        this.startAmOrPm = startAmOrPm;
    }

    public String getEndHour() {
        return endHour;
    }

    public void setEndHour(String endHour) {
        this.endHour = endHour;
    }

    public String getEndMinutes() {
        return endMinutes;
    }

    public void setEndMinutes(String endMinutes) {
        this.endMinutes = endMinutes;
    }
    
    public String getEndAmOrPm() {
        return endAmOrPm;
    }

    public void setEndAmOrPm(String endAmOrPm) {
        this.endAmOrPm = endAmOrPm;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public String getAvailability() {
        return availability;
    }

    public void setAvailability(String availability) {
        this.availability = availability;
    }

	public String getSpecialInst() {
		return specialInst;
	}

	public void setSpecialInst(String specialInst) {
		this.specialInst = specialInst;
	}
    
    public void parseEvent(Event e){
    	this.annOrEvent = "Event";
    	if(e.isPublicViewable()){
    		this.availability = "allUsers";
    	}else this.availability = "adminUsers";
    	this.description = e.getEventDescription();
    	this.details = e.getDetails();
    	this.title = e.getEventTitle();
    	this.endYear = e.getEndDate().getYear()+"";
    	this.endMonth = e.getEndDate().getMonth()+"";
    	this.endDay = e.getEndDate().getDay()+"";
    	this.endHour = e.getEndDate().getHours()+"";
    	this.endMinutes = e.getEndDate().getMinutes()+"";
    	this.startYear = e.getStartDate().getYear()+"";
    	this.startMonth = e.getStartDate().getMonth()+"";
    	this.startDay = e.getStartDate().getDay()+"";
    	this.startHour = e.getStartDate().getHours()+"";
    	this.startMinutes = e.getStartDate().getMinutes()+"";
    	this.location = e.getEventLocation();
    }
    
    public void parseAnnouncement(Announcement a){
    	this.annOrEvent = "Announcement";
    	if(a.isPublicViewable()){
    		this.availability = "allUsers";
    	}else this.availability = "adminUsers";
    	this.description = a.getAnnouncementDescription();
    	this.details = a.getAnnouncementDetails();
    	this.title = a.getAnnouncementTitle();
    	this.endYear = a.getEndDate().getYear()+"";
    	this.endMonth = a.getEndDate().getMonth()+"";
    	this.endDay = a.getEndDate().getDay()+"";
    	this.endHour = a.getEndDate().getHours()+"";
    	this.endMinutes = a.getEndDate().getMinutes()+"";
    	this.startYear = a.getStartDate().getYear()+"";
    	this.startMonth = a.getStartDate().getMonth()+"";
    	this.startDay = a.getStartDate().getDay()+"";
    	this.startHour = a.getStartDate().getHours()+"";
    	this.startMinutes = a.getStartDate().getMinutes()+"";
    	this.location = null;
    }
}
